package lambdasinaction.chap6.my;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @author Fish
 * @since 0.0.1 2018/7/26 23:28
 */
public class MyDish {

  public static final List<MyDish> menu = Arrays.asList(
      new MyDish("pork", false, 800, MyType.MEAT),
      new MyDish("beef", false, 700, MyType.MEAT),
      new MyDish("chicken", false, 400, MyType.MEAT),
      new MyDish("french fries", true, 530, MyType.OTHER),
      new MyDish("rice", true, 530, MyType.OTHER),
      new MyDish("season fruit", true, 120, MyType.OTHER),
      new MyDish("pizza", true, 550, MyType.OTHER),
      new MyDish("prawns", false, 400, MyType.FISH),
      new MyDish("salmon", false, 450, MyType.FISH)
  );
  private final String name;
  private final boolean vegetarian;
  private final int calories;
  private final MyType type;

  public MyDish(String name, boolean vegetarian, int calories,
      MyType type) {
    this.name = name;
    this.vegetarian = vegetarian;
    this.calories = calories;
    this.type = type;
  }

  public String getName() {
    return name;
  }

  public boolean isVegetarian() {
    return vegetarian;
  }

  public int getCalories() {
    return calories;
  }

  public MyType getType() {
    return type;
  }

  @Override
  public String toString() {
    return name;
  }

  public enum MyType {MEAT, FISH, OTHER}


  public static final Map<String, List<String>> dishTags = new HashMap<>();

  static {
    dishTags.put("pork", Arrays.asList("greasy", "salty"));
    dishTags.put("beef", Arrays.asList("salty", "roasted"));
    dishTags.put("chicken", Arrays.asList("fried", "crisp"));
    dishTags.put("french fries", Arrays.asList("greasy", "fried"));
    dishTags.put("rice", Arrays.asList("light", "natural"));
    dishTags.put("season fruit", Arrays.asList("fresh", "natural"));
    dishTags.put("pizza", Arrays.asList("tasty", "salty"));
    dishTags.put("prawns", Arrays.asList("tasty", "roasted"));
    dishTags.put("salmon", Arrays.asList("delicious", "fresh"));
  }
}
